<?php

namespace App\Http\Controllers\user;

use App\Dao\UserBankDao;
use App\Services\Code;

class UserBankController extends BaseController
{
    public function user_banks(): array
    {
        return Code::message('',200,UserBankDao::user_bank_cards([
            'user_id'=>getUserToken()
        ]));
    }


    public function add_user_bank()
    {
        $params = array_merge([
            'user_id'=>getUserToken()
        ],request()->all());
        UserBankDao::add_user_bank($params);
        return Code::message('',200);
    }

    public function update_user_bank()
    {
        $params = array_merge([
            'user_id'=>getUserToken()
        ],request()->all());
        UserBankDao::update_user_bank($params);
        return Code::message('',200);
    }


    public function delete_user_bank()
    {
        $params = array_merge([
            'user_id'=>getUserToken()
        ],request()->all());
        UserBankDao::delete_user_bank($params);
        return Code::message('',200);
    }


    public function user_create_widthwal(): array
    {
        $params = array_merge([
            'user_id'=>getUserToken()
        ],request()->all());
        UserBankDao::user_create_widthwal($params);
        return Code::message('',200);
    }
}
